home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
SYS
/
s
/
mailer.wrx
< prev
next >
Wrap
Text File
|
1996-09-26
|
2KB
|
114 lines
/*
* dieses Script arbeitet genauso wie open.wrx nur das es anstatt
* dem voreingestellten Konfigurationfile, den Konfigurationsfile
* "MAILER.config" läd
*
* usage : rx MAILER.wrx [#screen] [#run] FileName
*
*/
IF ~show('P',"WRITE")
THEN DO
IF Open(File,"ENV:WRITE",r) THEN DO
WRITEPATH = READLN(File)
Close(File)
ADDRESS "COMMAND"
"run >NIL: <NIL: " || WRITEPATH
"SYS:REXXC/WaitForPort <NIL: >NIL: WRITE"
END
ELSE DO
say "Kann WRITE nicht finden !"
END
END
PARSE ARG A.1 A.2 A.3
runit = FALSE
screenit = FALSE
FileName = ""
DO i = 1 TO 3
IF A.i="#run" THEN DO
runit = TRUE
END
ELSE DO
IF A.i="#screen" THEN DO
screenit = TRUE
END
ELSE DO
IF A.i~="" THEN DO
FileName=A.i
END
END
END
END
FileName=strip(FileName)
FileName=strip(FileName,'B','"')
IF length(FileName)~=0
THEN DO
IF pos(':',FileName)=0
THEN DO
DirName=pragma('D')
IF right(DirName,1)~=':' THEN
DirName=DirName||'/'
FileName=DirName||FileName
END
END
ADDRESS "WRITE"
OPTIONS RESULTS
'VERSIONCHECK 3848 "Mailer.wrx"'
IF RC~=0 THEN DO
exit 10
END
'NEWED "MAILER.CONFIG"'
ID = RESULT
OPENPORT ID
Port = RESULT
IF Port = ""
THEN DO
"MESSAGEOK (REXX-script 'mailer.wrx' :\nSorry, no more private ports!)"
EXIT
END
INTERPRET ADDRESS Port
"WINDOW 0 0 0 0 {@SIMPLEWIN}"
"SETVAR (_Path) ("||FileName||")"
IF length(FileName)~=0
THEN DO
IF exists(FileName) then
"OPEN ("||FileName||")"
ELSE
"SETVAR (_FileName) ("||FileName||")"
END
ELSE DO
FileName=pragma('D')
IF right(FileName,1)~=':' THEN
FileName=FileName||'/'
"SETVAR (_Path) ("||FileName||")"
END
IF (screenit = TRUE) & (runit = FALSE) THEN DO
MODIFYSCREEN 0
END
IF (runit = FALSE) THEN DO
WAITPORT ID
END
IF (screenit = TRUE) & (runit = FALSE) THEN DO
IF show('P',"WRITE") THEN DO
ADDRESS "WRITE"
MODIFYSCREEN 1
END
END